import 'package:flutter/material.dart';

class ContainerMyWidget extends StatelessWidget {
  const ContainerMyWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.blue[300],
        title: Text('Container组件'),
      ),
      body: Container(
        alignment: Alignment.center,
        child: Container(
          width: 200,
          height: 200,
          color: Colors.green[200],
          // padding: EdgeInsets.all(10),
          padding: EdgeInsets.only(left: 10, top: 20, right: 30, bottom: 40),
          child: Container(
            // color: Colors.pink[200], // 当设置了decoration属性, 同级color属性就不能设置
            decoration: BoxDecoration(
              color: Colors.pink[200],
              border: Border.all(width: 1),
              // borderRadius: BorderRadius.circular(10),
              borderRadius: BorderRadius.only(
                topLeft: Radius.elliptical(10, 20),
                topRight: Radius.circular(20),
              ),
            ),
            child: Text("这是Container容器组件"),
          ),
        ),
      ),
    );
  }
}
